package com.study.spmongodb.book.wwj.char08;

/**
 * @author MI
 * @version 1.0
 * @date 2020/11/25 22:17
 */
public interface RunnableQueue {
    /**
     * 当有新的线程进来时首先会offer到队列中
     *
     * @param runnable
     */
    void offer(Runnable runnable);


    Runnable take() throws InterruptedException;

    /**
     * 获取任务队列中任务的数量
     *
     * @return
     */
    int size();
}
